// JavaScript Document
function checkFileSize()
{
	var file_size = 0;
	if (navigator.userAgent.indexOf("Firefox") != -1){
		file_size = checkFileSizeFireFox();
	}else{
		file_size = checkFileSizeIE();
	}
	return file_size;
}

//Check file size before upload, it is working well with Firefox
//It is not compatible with another browse
function checkFileSizeFireFox() {
	var node = document.getElementById('userfile');
	return node.files[0].fileSize;
}

// It is working well with IE
function checkFileSizeIE()
{
	var myFSO = new ActiveXObject("Scripting.FileSystemObject");
	var filepath = document.mainForm.userfile;
	var thefile = myFSO.getFile(filepath);
	var size = thefile.size;
	return size;
}